
import { getDict } from '@/utils/index'
import { transferLabelAndValue } from '@/utils/pre-sale'
const dict = getDict([
    '跟进方式',
    '客户级别',
    '跟进方式',
    '跟进结果',
    '来源渠道',
    '性别',
])
export const rulesForm = [
    {
        "type": "input", "field": "userName", "value": "",
        title: "客户名称",
        props: {
            placeholder: "客户名称",
        },
        col: {
            span: 6, labelWidth: '140px'
        },
        class: "w-100",
        validate: [{ required: true, message: '请输入客户名称', trigger: ['blur', 'change'], },]
    },
    {
        "type": "input", "field": "phone", "value": "",
        title: "客户手机",
        props: {
            placeholder: "客户手机",
            maxlength:11
        },
        col: {
            span: 6, labelWidth: '140px'
        },
        class: "w-100",
        validate: [{ required: true, message: '请输入客户手机', trigger: ['blur', 'change'] },
    
        { required: true, pattern:/^1\d{10}$/,message: '请输入正确的手机号码', trigger: ['blur', 'change']}]

    },
    {
        "type": "input", "field": "identity", "value": "",
        title: "身份证号码",
        props: {
            placeholder: "身份证号码",
        },
        col: {
            span: 6,
            labelWidth: '140px'
        },
        class: "w-100",
        // validate: [{ required: true, message: '请输入隧道编码', trigger: ['blur', 'change'], },]

    },

    {
        "type": "select", "field": "sex", "value": '男',
        title: "性别",
        props: {
            placeholder: "性别",

        },
        col: {

            span: 6, labelWidth: '140px'
        },
        options: transferLabelAndValue(dict['性别']),
        class: "w-100",

    },
    {
        "type": "DatePicker",
        "field": "firstDriveLicenseDate",
        "value": "",
        title: "驾驶证领证日期",
        props: {
            "type": "date",
            format:"yyyy-MM-dd",
            valueFormat:"yyyy-MM-dd HH:mm:ss",
            placeholder: "驾驶证领证日期",
        },
        col: {
            span: 6,
            labelWidth: '140px',
        },
        class: 'w-100',
    },


    {
        "type": "select", "field": "level", "value": "",
        title: "客户级别",
        props: {
            placeholder: "客户级别",
        },
        col: {

            span: 6, labelWidth: '140px'
        },
        options: transferLabelAndValue(dict['客户级别']),
        class: "w-100",

    },

    {
        "type": "select", "field": "sourceId", "value": '',
        title: "来源渠道",
        props: {
            placeholder: "来源渠道",

        },
        col: {

            span: 6, labelWidth: '140px'
        },
        options: transferLabelAndValue(dict['来源渠道']),
        class: "w-100",

    },


    {
        "type": "input", "field": "age", "value": "",
        title: "年龄",
        props: {
            placeholder: "年龄",
        },
        col: {
            span: 6, labelWidth: '140px'
        },
        class: "w-100",

    },
    {
        "type": "input", "field": "buyUse", "value": "",
        title: "购车用途",
        props: {
            placeholder: "购车用途",
        },
        col: {
            span: 6, labelWidth: '140px'
        },
        class: "w-100",

    },

    {
        "type": "input", "field": "buyNum", "value": "",
        title: "购买次数",
        props: {
            placeholder: "购买次数",
        },
        col: {
            span: 6, labelWidth: '140px'
        },
        class: "w-100",

    },

    

    {
        "type": "input", "field": "address", "value": "",
        title: "居住地址:",
        props: {
            placeholder: "居住地址",
        },
        col: {
            span: 6, labelWidth: '140px'
        },
        class: "w-100",

    },
    {
        "type": "select", "field": "storeId", "value": "",
        title: "所属门店",
        props: {
            placeholder: "所属门店",
        },
        col: {

            span: 6, labelWidth: '140px'
        },
        options: [],
        class: "w-100",

    },
    {
        "type": "input", "field": "remark", "value": "",
        title: "备注:",
        props: {
            placeholder: "备注",
            type:'textarea'
        },
        col: {
            span: 24,
             labelWidth: '140px'
        },
        class: "w-100",

    },
    {
        type: 'el-col',
        title: "上传驾驶证:",
        col: {
            span: 24,
            labelWidth: '140px'
        },
        children: [
            {
                "type": "UploadImage", "field": "driveLicenseFront", "value": "",
                title: "",
                props: {
                    topTitle: '主页'
                },
                col: {
                    span: 12,
                },
                class: "w-100",

            },
            {
                "type": "UploadImage", "field": "driveLicenseBack", "value": "",
                title: "",
                props: {
                    topTitle: '附页'
                },
                col: {
                    span: 12,

                },
                class: "w-100",

            },
        ]

    },





]